<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Search Services</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <form style="width: 50%; position: absolute; left: 25%;" class="navbar-form navbar-left" role="search">
        <div class="form-group" style="width: 90%;">
          <input style="width: 100%;" type="text" class="form-control" placeholder="Search" >
        </div>
        <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <?php if (isset($usuario_logado)) {?>
        <li><a href="#">
        	<span class="glyphicon glyphicon-usd" style="right: 5px;"></span>Anunciar
        </a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <?php echo $this->Html->image($this->Usuario->urlPhotoByUsuario($usuario_logado), array('height' => '20px')) ?>
          	<?php echo $usuario_logado['Usuario']['username']; ?>
          	<span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu" style="margin-top: 40%">
            <li><?php echo $this->Html->link('Conta', "#", array('class' => 'modal_open conta')); ?></li>
            <li><?php echo $this->Html->link('Sair', $this->Html->url('/usuarios/logout', true)); ?></li>
          </ul>
        </li>
        <?php } ?>

        <?php if (!isset($usuario_logado)) {?>
        <li><a href="#">
        	<span class="glyphicon glyphicon-ok" style="right: 5px;"></span>Cadastre-se
        </a></li>
        <li class="active"><a href="#">
        	<span class="glyphicon glyphicon-log-in" style="right: 5px;"></span>Entrar
        </a></li>
        <?php } ?>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>